aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
committerAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
commit56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch)
treed6bc2557c56b93177bb14aa376847c6e123a4862 /src/routes/(app)/[username]
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'src/routes/(app)/[username]')
-rw-r--r--src/routes/(app)/[username]/(profile)/+layout.svelte75
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.svelte16
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.ts3
-rw-r--r--src/routes/(app)/[username]/(profile)/notes/new/+page.svelte7
-rw-r--r--src/routes/(app)/[username]/+layout.server.ts7
-rw-r--r--src/routes/(app)/[username]/accepted/[text]/+page.svelte20
-rw-r--r--src/routes/(app)/[username]/accepted/create/+page.svelte19
-rw-r--r--src/routes/(app)/[username]/receive/+page.svelte22
8 files changed, 38 insertions, 131 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte
index 1bb9447f..6e6a318f 100644
--- a/src/routes/(app)/[username]/(profile)/+layout.svelte
+++ b/src/routes/(app)/[username]/(profile)/+layout.svelte
@@ -37,18 +37,14 @@
let stripped = $derived(n.replace(/\s/g, ""));
let username = $derived(n.length > 60 ? n.substr(0, 6) : display || stripped);
let lnaddr = $derived(
- subject?.anon
- ? subject.lud16 || undefined
- : `${stripped}@${$page.url.host}`,
+ subject?.anon ? subject.lud16 || undefined : `${stripped}@${$page.url.host}`,
);
let profile = $derived(`${$page.url.host}/${subject.anon ? npub : stripped}`);
let lnurl = $derived(
encode(
"lnurl",
toWords(
- new TextEncoder().encode(
- `https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`,
- ),
+ new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`),
),
20000,
),
@@ -57,33 +53,19 @@
<div class="container mx-auto w-full px-4 flex flex-wrap lg:flex-nowrap">
<div class="hidden lg:block lg:w-[280px] xl:w-[360px]"></div>
- <div
- class="w-full lg:w-[280px] xl:w-[360px] lg:absolute space-y-2 left-20 mx-auto"
- >
- <div
- class="flex text-3xl font-bold text-center mx-auto justify-center gap-1 items-center"
- >
+ <div class="w-full lg:w-[280px] xl:w-[360px] lg:absolute space-y-2 left-20 mx-auto">
+ <div class="flex text-3xl font-bold text-center mx-auto justify-center gap-1 items-center">
<button class="flex gap-1 items-center" onclick={toggleDetails}>
<div class="break-words">{display || username}</div>
<iconify-icon noobserver icon="ph:list-bold" width="32"></iconify-icon>
</button>
{#if subject.id === user?.id}
- <a
- href="/settings/profile"
- class="btn contents"
- aria-label="Edit profile"
- >
- <iconify-icon noobserver icon="ph:pencil-bold" width="32"
- ></iconify-icon>
+ <a href="/settings/profile" class="btn contents" aria-label="Edit profile">
+ <iconify-icon noobserver icon="ph:pencil-bold" width="32"></iconify-icon>
</a>
{:else}
- <a
- href="/dm?username={subject.username}"
- class="btn contents"
- aria-label="Direct Message"
- >
- <iconify-icon noobserver icon="ph:chat-bold" width="32"
- ></iconify-icon>
+ <a href="/dm?username={subject.username}" class="btn contents" aria-label="Direct Message">
+ <iconify-icon noobserver icon="ph:chat-bold" width="32"></iconify-icon>
</a>
{/if}
<!-- <a href={`/${subject.pubkey}/notes`}> -->
@@ -128,16 +110,14 @@
aria-label="Copy lightning address"
onclick={() => copy(lnaddr)}
>
- ><iconify-icon noobserver icon="ph:copy-bold" width="32"
- ></iconify-icon></button
+ ><iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon></button
>
<a
href={`/qr/${encodeURIComponent(lnaddr)}`}
class="my-auto"
aria-label="Show lightning address QR"
>
- <iconify-icon noobserver icon="ph:qr-code-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon>
</a>
</div>
</div>
@@ -156,18 +136,14 @@
aria-label="Copy profile URL"
onclick={() => copy(profile)}
>
- ><iconify-icon noobserver icon="ph:copy-bold" width="32"
- ></iconify-icon></button
+ ><iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon></button
>
<a
- href={`/qr/${encodeURIComponent(
- `${$page.url.protocol}//${profile}`,
- )}`}
+ href={`/qr/${encodeURIComponent(`${$page.url.protocol}//${profile}`)}`}
class="my-auto"
aria-label="Show profile URL QR"
>
- <iconify-icon noobserver icon="ph:qr-code-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon>
</a>
</div>
</div>
@@ -185,16 +161,14 @@
aria-label="Copy LNURL"
onclick={() => copy(`lightning:${lnurl}`)}
>
- ><iconify-icon noobserver icon="ph:copy-bold" width="32"
- ></iconify-icon></button
+ ><iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon></button
>
<a
href={`/${n}/accepted/${encodeURIComponent(`lightning:${lnurl}`)}`}
class="my-auto"
aria-label="Show LNURL QR"
>
- <iconify-icon noobserver icon="ph:qr-code-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:qr-code-bold" width="32"></iconify-icon>
</a>
</div>
</div>
@@ -259,8 +233,7 @@
aria-label="Reset password"
>
<div class="mx-auto flex">
- <iconify-icon noobserver icon="ph:clock" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:clock" width="32"></iconify-icon>
</div>
</button>
</form>
@@ -269,9 +242,7 @@
</div>
<div class="w-full">
- <div
- class="mx-auto space-y-5 lg:max-w-xl xl:max-w-2xl lg:pl-10 mt-5 lg:mt-0"
- >
+ <div class="mx-auto space-y-5 lg:max-w-xl xl:max-w-2xl lg:pl-10 mt-5 lg:mt-0">
{@render children?.()}
</div>
</div>
@@ -293,20 +264,12 @@
{#if satsPerCurrency >= 1}
<div>{f(1, currency, locale)} &#61;</div>
<div class="flex items-center">
- <iconify-icon
- noobserver
- icon="ph:lightning-fill"
- class="text-yellow-300"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon>
{s(satsPerCurrency)}
</div>
{:else}
<div class="flex items-center">
- <iconify-icon
- noobserver
- icon="ph:lightning-fill"
- class="text-yellow-300"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon>
1
</div>
<div>&#61; {f(1 / satsPerCurrency, currency, locale)}</div>
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte
index fb4d6dd9..78816e36 100644
--- a/src/routes/(app)/[username]/(profile)/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/+page.svelte
@@ -73,8 +73,7 @@
aria-label={$t("accounts.addAccount")}
title={$t("accounts.addAccount")}
>
- <iconify-icon noobserver icon="ph:plus-bold" width="28"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:plus-bold" width="28"></iconify-icon>
</button>
</a>
</div>
@@ -88,8 +87,7 @@
{#if $installPrompt}
<button class="btn btn-accent lg:hidden" onclick={install}>
- <iconify-icon noobserver icon="ph:floppy-disk-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:floppy-disk-bold" width="32"></iconify-icon>
{$t("user.install")}
</button>
{/if}
@@ -106,14 +104,8 @@
: `/pay/${subject.username}`}
class="contents"
>
- <button
- class="btn btn-accent !text-2xl items-center !w-full sm:!max-w-[400px] mx-auto"
- >
- <iconify-icon
- noobserver
- icon="ph:lightning-fill"
- class="text-yellow-300"
- ></iconify-icon>
+ <button class="btn btn-accent !text-2xl items-center !w-full sm:!max-w-[400px] mx-auto">
+ <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300"></iconify-icon>
<div>
{$t("user.pay")}
{subject.username}
diff --git a/src/routes/(app)/[username]/(profile)/+page.ts b/src/routes/(app)/[username]/(profile)/+page.ts
index 0a6c78b2..e6a3ffeb 100644
--- a/src/routes/(app)/[username]/(profile)/+page.ts
+++ b/src/routes/(app)/[username]/(profile)/+page.ts
@@ -5,6 +5,5 @@ import { get } from "svelte/store";
export const ssr = false;
export async function load() {
const sk = cookies.get("sk");
- if (sk && !get(signer))
- signer.set({ method: "nsec", params: { sk }, ready: true });
+ if (sk && !get(signer)) signer.set({ method: "nsec", params: { sk }, ready: true });
}
diff --git a/src/routes/(app)/[username]/(profile)/notes/new/+page.svelte b/src/routes/(app)/[username]/(profile)/notes/new/+page.svelte
index ff4524e1..a9cc3e19 100644
--- a/src/routes/(app)/[username]/(profile)/notes/new/+page.svelte
+++ b/src/routes/(app)/[username]/(profile)/notes/new/+page.svelte
@@ -32,10 +32,7 @@
<div class="container px-4 max-w-xl mx-auto space-y-5">
<form method="POST" class="space-y-2 text-xl" onsubmit={submit}>
- <textarea use:focus bind:value={content} placeholder={$t("notes.contents")}
- ></textarea>
- <button type="submit" class="btn btn-accent">
- {$t("payments.submit")}</button
- >
+ <textarea use:focus bind:value={content} placeholder={$t("notes.contents")}></textarea>
+ <button type="submit" class="btn btn-accent"> {$t("payments.submit")}</button>
</form>
</div>
diff --git a/src/routes/(app)/[username]/+layout.server.ts b/src/routes/(app)/[username]/+layout.server.ts
index ab755410..5e921541 100644
--- a/src/routes/(app)/[username]/+layout.server.ts
+++ b/src/routes/(app)/[username]/+layout.server.ts
@@ -1,12 +1,7 @@
import { get } from "$lib/utils";
import { error } from "@sveltejs/kit";
-export const load = async ({
- cookies,
- depends,
- params: { username },
- parent,
-}) => {
+export const load = async ({ cookies, depends, params: { username }, parent }) => {
depends("app:user");
try {
diff --git a/src/routes/(app)/[username]/accepted/[text]/+page.svelte b/src/routes/(app)/[username]/accepted/[text]/+page.svelte
index 339f6c9c..3e16177c 100644
--- a/src/routes/(app)/[username]/accepted/[text]/+page.svelte
+++ b/src/routes/(app)/[username]/accepted/[text]/+page.svelte
@@ -14,35 +14,23 @@
let lnurl = $derived(
`https://${PUBLIC_DOMAIN}/ln/${encode(
"lnurl",
- toWords(
- new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${username}`),
- ),
+ toWords(new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${username}`)),
20000,
)}`,
);
</script>
<div class="px-2">
- <div
- class="border-8 border-black p-8 max-w-[580px] mx-auto mt-20 space-y-2 rounded-3xl relative"
- >
+ <div class="border-8 border-black p-8 max-w-[580px] mx-auto mt-20 space-y-2 rounded-3xl relative">
<div class="flex gap-2 mx-auto justify-center">
<!-- <img src="/images/bitcoin.png" class="w-16 h-16 my-auto" /> -->
- <img
- src="/images/bitcoin-logo.png"
- class="my-auto w-[400px]"
- alt="Bitcoin"
- />
+ <img src="/images/bitcoin-logo.png" class="my-auto w-[400px]" alt="Bitcoin" />
<!-- <h3 class="text-5xl font-bold text-center my-auto"> -->
<!-- bitcoin -->
<!-- </h3> -->
</div>
{#if nfc}
- <img
- src="/images/tap.png"
- class="w-24 absolute top-52 left-4 rotate-[-10deg]"
- alt="Tap"
- />
+ <img src="/images/tap.png" class="w-24 absolute top-52 left-4 rotate-[-10deg]" alt="Tap" />
<img
src="/images/arrow.png"
class="w-24 scale-x-[-1] rotate-[120deg] absolute top-52 left-32 w-20 h-52"
diff --git a/src/routes/(app)/[username]/accepted/create/+page.svelte b/src/routes/(app)/[username]/accepted/create/+page.svelte
index 189a734d..3a17bcc0 100644
--- a/src/routes/(app)/[username]/accepted/create/+page.svelte
+++ b/src/routes/(app)/[username]/accepted/create/+page.svelte
@@ -8,8 +8,7 @@
text = $state(),
pasted = $state();
- let keypress = (e) =>
- e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false);
+ let keypress = (e) => (e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false));
let paste = async () => {
text = await navigator.clipboard.readText();
@@ -24,9 +23,7 @@
</script>
<div class="container px-4 max-w-lg mx-auto space-y-5 mt-20">
- <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold">
- Create QR
- </h1>
+ <h1 class="px-3 md:px-0 text-center text-3xl md:text-4xl font-semibold">Create QR</h1>
<form onsubmit={preventDefault(submit)} class="space-y-2 text-xl">
<div class="mb-2">
@@ -48,11 +45,7 @@
class="flex border rounded-2xl px-6 py-5 font-bold hover:opacity-80 w-full bg-primary justify-center gap-2"
onclick={paste}
>
- <iconify-icon
- noobserver
- icon="ph:clipboard-text-bold"
- width="32"
- class="my-auto"
+ <iconify-icon noobserver icon="ph:clipboard-text-bold" width="32" class="my-auto"
></iconify-icon>
<div class="my-auto">{$t("user.send.paste")}</div>
</button>
@@ -62,11 +55,7 @@
type="submit"
class="flex bg-black text-white border rounded-2xl px-6 py-5 w-full font-bold gap-2 justify-center"
>
- <iconify-icon
- noobserver
- icon="ph:paper-plane-right-bold"
- width="32"
- class="my-auto invert"
+ <iconify-icon noobserver icon="ph:paper-plane-right-bold" width="32" class="my-auto invert"
></iconify-icon>
<div class="my-auto">{$t("user.dashboard.go")}</div>
</button>
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte
index 6921d443..14489c13 100644
--- a/src/routes/(app)/[username]/receive/+page.svelte
+++ b/src/routes/(app)/[username]/receive/+page.svelte
@@ -1,18 +1,6 @@
<script lang="ts">
import { run } from "svelte/legacy";
- import {
- btc,
- loc,
- post,
- copy,
- fail,
- f,
- get,
- types,
- sat,
- s,
- sats,
- } from "$lib/utils";
+ import { btc, loc, post, copy, fail, f, get, types, sat, s, sats } from "$lib/utils";
import { tick, onMount, onDestroy } from "svelte";
import { browser } from "$app/environment";
import { last, showQr, amountPrompt } from "$lib/store";
@@ -117,12 +105,8 @@
let settingMemo = $state();
let toggleMemo = () => (settingMemo = !settingMemo);
- let link = $derived(
- [types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`,
- );
- let txt = $derived(
- [types.bitcoin, types.liquid].includes(type) ? hash : text,
- );
+ let link = $derived([types.bitcoin, types.liquid].includes(type) ? text : `lightning:${text}`);
+ let txt = $derived([types.bitcoin, types.liquid].includes(type) ? hash : text);
onMount(() => {
if ($amountPrompt && !amount) toggleAmount();